﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PartyCalculator2._0
{
    class Party
    {
        const int CostOfFoodPerPerson = 25;
        private bool fancyDecorations;
        public decimal CostOfDecorations = 0.00M;

            public Party(int numberOfPeople, bool fancyDecorations)
        {
            this.numberOfPeople = numberOfPeople;
            this.fancyDecorations = fancyDecorations;
            
        }

        private int numberOfPeople;
        public virtual int NumberOfPeople
        {
            get { return numberOfPeople; }
            set
            {
                numberOfPeople = value;
                CalculateCostOfDecorations(fancyDecorations);
            }
        }
        
        public void CalculateCostOfDecorations(bool fancyOption)
        {
            fancyDecorations = fancyOption;
            if (fancyOption)
                CostOfDecorations = (15.00M * NumberOfPeople) + 50.00M;
            else
                CostOfDecorations = (7.50M * NumberOfPeople) + 30.00M;
        }

        public virtual decimal CalculateCost()
        {
            decimal totalCost = CostOfDecorations + (CostOfFoodPerPerson * NumberOfPeople);
            if (NumberOfPeople > 12)
                totalCost += 100.00M;
            return totalCost;
        }
    }
}
